package Test;

import Ctr.AttendanceCtr;
import Ctr.SessionCtr;
import DB.TeacherDB;
import Model.Session;
import org.junit.Test;

import static org.junit.Assert.fail;

/**
 * Created by Emil on 11-12-13.
 */
public class SessionCtrTest {
    //OKay
    @Test
    public void testGetSessionByTeacherAndDate()
    {
        SessionCtr sessionCtr = new SessionCtr();
        TeacherDB teacherDB = new TeacherDB();

        Session session = sessionCtr.getSessionByTeacherAndDate(teacherDB.findTeacherByID(23),"2013-09-02");
        if(session != null)
        {
            System.out.println(session.getId());
            System.out.println(session.getDate());
            System.out.println(session.getTeacherId().getId());
            System.out.println(session.getTeacherId().getInitials());
            System.out.println(session.getTeamId().getId());
            System.out.println(session.getTeamId().getName());
            System.out.println(session.getCourseId().getId());
            System.out.println(session.getCourseId().getName());
        }
        else
        {
            fail("Failed finding session - session is null");
        }

    }
}
